import request from "@/utils/request";

export const apiGetUserExamScore = (examId) => {
  return request.get("/exam/examScore?examId=" + examId);
};

export const apiCheckToLimit = (examId) => {
  return request.get("/exam/checkToLimit?examId=" + examId); //检查是否达到考试限制次数
};

export const apiQueryExamById = (id) => {
  return request.get("/exam/queryById?id=" + id);
};

export const apiListExamIn = () => {
  return request.get("/exam/listExamIn");
};

export const apiCreateExam = (examId) => {
  return request.get("/exam/createExam?examId=" + examId);
};

export const apiExamDetail = (userExamId) => {
  return request.get("/exam/examDetail?userExamId=" + userExamId);
};

export const apiExamRecordExist = (examId) => {
  return request.get("/exam/examRecordExist?examId=" + examId); //检查是否有考试记录
};

export const apiGetExamList = (params) => {
  return request.post("/exam/list", params);
};


export const apiSubmitExam = (params) => {
  return request.post("/exam/submitExam", params);
};

export const apiCacheExamAnswer = (params) => {
  return request.post("/exam/cacheExamAnswer", params);
};

export const apiGetCacheAnswer = (userExamId) => {
  return request.get("/exam/getCacheAnswer?userExamId=" + userExamId);
};

export const apiUserExamResultDetail = (userExamId) => {
  return request.get("/exam/userExamResultDetail?userExamId=" + userExamId);
};

export const apiUserExamResultList = (params) => {
  return request.post("/exam/userExamResult/list", params);
};

export const apiUserExamDetailList = (params) => {
  return request.post("/exam/userExamDetail/list", params);
};

export const apiUploadExamSnap = (params) => {
  return request.post("/exam/uploadExamSnap", params);
};
